/**
 * -*- coding:utf-8 -*-
 *
 * @time: 2025/11/4 16:59
 * @author:lhl
 * @编辑器: IntelliJ IDEA
 */
package com.ljs.Service.Impl;

import com.ljs.Dao.Impl.UserDaoImpl;
import com.ljs.Dao.UserDao;
import com.ljs.Service.Service;
import com.ljs.entity.User;

public class UserServiceImpl implements Service {
    @Override
    public boolean zhuce(String username, String password) {
        UserDao udao = new UserDaoImpl();
        User user = udao.selectByUsernameAndPassword(username, password);
        if (user != null) {
            System.out.println("用户名已存在，请重新输入");
            return false;
        }
        int i = udao.insertUser(user);
        if (i>0){
            System.out.println("注册成功");
            return  true;
        }
        return false;
    }
}
